package 锁;

import java.util.concurrent.TimeUnit;

/**
 * @author: 谢君臣
 * @Date: 2021/11/16-14:33
 * @version: 1.0
 * @function:
 */
public class Test {
    public static void main(String[] args) {
        ZeroEvenOdd test = new ZeroEvenOdd(5);
        ZeroEvenOdd.IntConsumer consumer = test.new IntConsumer();
        new Thread(()->{
            test.zero(consumer);
        },"A").start();
        new Thread(()->{
            test.even(consumer);
        },"B").start();
        new Thread(()->{
            test.odd(consumer);
        },"C").start();

        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
